package com.yh.patterns.combination.demo;

/**
 * @Auther:云尚学Java
 */
public class Client {
    public static void main(String[] args) {
        //创建组织树结构
        OrganizationComponent organization=new Organization("北京总部",1);
        OrganizationComponent organization1=new Organization("教务办公室",2);
        OrganizationComponent organization2=new Organization("湖南分校",2);
        OrganizationComponent organization3=new Organization("行政办公室",2);
        organization2.add(new OrganizationItem("教务办公室",3));
        organization2.add(new OrganizationItem("长沙教学点",3));
        Organization org=new Organization("教务办公室",4);
        Organization org1=new Organization("行政办公室",4);
        organization2.add(new OrganizationItem("湘潭教学点",3));
        Organization org2=new Organization("教务办公室",4);
        Organization org3=new Organization("行政办公室",4);
        organization2.add(new OrganizationItem("行政办公室",3));

        //将二级添加到一级
        organization.add(organization1);
        organization.add(organization2);
        organization.add(organization3);
        //讲三级添加到二级
        //organization2.add(org);
        //organization2.add(org1);


    }
}
